<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

  <title>Class: ExceptionsController</title>

  <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />

  <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
  <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>

</head>
<body id="top" class="class">

  <div id="metadata">
    <div id="home-metadata">
      <div id="home-section" class="section">
        <h3 class="section-header">
          <a href="./index.html">Home</a>
          <a href="./index.html#classes">Classes</a>
          <a href="./index.html#methods">Methods</a>
        </h3>
      </div>
    </div>

    <div id="file-metadata">
      <div id="file-list-section" class="section">
        <h3 class="section-header">In Files</h3>
        <div class="section-body">
          <ul>
          
            <li><a href="./app/controllers/exceptions_controller_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
              class="thickbox" title="app/controllers/exceptions_controller.rb">app/controllers/exceptions_controller.rb</a></li>
          
          </ul>
        </div>
      </div>

      
    </div>

    <div id="class-metadata">
      
      <!-- Parent Class -->
      <div id="parent-class-section" class="section">
        <h3 class="section-header">Parent</h3>
        
        <p class="link"><a href="ApplicationController.html">ApplicationController</a></p>
        
      </div>
      

      

      

      
      <!-- Method Quickref -->
      <div id="method-list-section" class="section">
        <h3 class="section-header">Methods</h3>
        <ul class="link-list">
          
          <li><a href="#method-i-change_status">#change_status</a></li>
          
          <li><a href="#method-i-delete_exception_class">#delete_exception_class</a></li>
          
          <li><a href="#method-i-get_exception">#get_exception</a></li>
          
          <li><a href="#method-i-get_exceptions_list">#get_exceptions_list</a></li>
          
          <li><a href="#method-i-index">#index</a></li>
          
          <li><a href="#method-i-list">#list</a></li>
          
          <li><a href="#method-i-list_statuswise_exceptions">#list_statuswise_exceptions</a></li>
          
          <li><a href="#method-i-save_exception_class">#save_exception_class</a></li>
          
          <li><a href="#method-i-save_exception_class_form">#save_exception_class_form</a></li>
          
          <li><a href="#method-i-show">#show</a></li>
          
          <li><a href="#method-i-show_exception_backtrace">#show_exception_backtrace</a></li>
          
          <li><a href="#method-i-show_exception_environment">#show_exception_environment</a></li>
          
        </ul>
      </div>
      

      
    </div>

    <div id="project-metadata">
      
      
      <div id="fileindex-section" class="section project-section">
        <h3 class="section-header">Files</h3>
        <ul>
        
          <li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a></li>
        
        </ul>
      </div>
      

      <div id="classindex-section" class="section project-section">
        <h3 class="section-header">Class/Module Index
          <span class="search-toggle"><img src="./images/find.png"
            height="16" width="16" alt="[+]"
            title="show/hide quicksearch" /></span></h3>
        <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
        <fieldset>
          <legend>Quicksearch</legend>
          <input type="text" name="quicksearch" value=""
            class="quicksearch-field" />
        </fieldset>
        </form>

        <ul class="link-list">
        
          <li><a href="./Analytics.html">Analytics</a></li>
        
          <li><a href="./Analytics/Database.html">Analytics::Database</a></li>
        
          <li><a href="./Analytics/ResourceUsage.html">Analytics::ResourceUsage</a></li>
        
          <li><a href="./Analytics/Throughput.html">Analytics::Throughput</a></li>
        
          <li><a href="./Analytics/Url.html">Analytics::Url</a></li>
        
          <li><a href="./Analytics/UrlBreakup.html">Analytics::UrlBreakup</a></li>
        
          <li><a href="./ActionView.html">ActionView</a></li>
        
          <li><a href="./ActionView/Helpers.html">ActionView::Helpers</a></li>
        
          <li><a href="./ActionView/Helpers/AssetTagHelper.html">ActionView::Helpers::AssetTagHelper</a></li>
        
          <li><a href="./AdminController.html">AdminController</a></li>
        
          <li><a href="./AdminHelper.html">AdminHelper</a></li>
        
          <li><a href="./App.html">App</a></li>
        
          <li><a href="./AppException.html">AppException</a></li>
        
          <li><a href="./AppTimeSample.html">AppTimeSample</a></li>
        
          <li><a href="./ApplicationController.html">ApplicationController</a></li>
        
          <li><a href="./ApplicationHelper.html">ApplicationHelper</a></li>
        
          <li><a href="./ApplicationSpecification.html">ApplicationSpecification</a></li>
        
          <li><a href="./ApplicationSpecificationController.html">ApplicationSpecificationController</a></li>
        
          <li><a href="./ApplicationSpecificationHelper.html">ApplicationSpecificationHelper</a></li>
        
          <li><a href="./Control.html">Control</a></li>
        
          <li><a href="./ExceptionDetail.html">ExceptionDetail</a></li>
        
          <li><a href="./ExceptionsController.html">ExceptionsController</a></li>
        
          <li><a href="./ExceptionsHelper.html">ExceptionsHelper</a></li>
        
          <li><a href="./GraphController.html">GraphController</a></li>
        
          <li><a href="./GraphHelper.html">GraphHelper</a></li>
        
          <li><a href="./Headers.html">Headers</a></li>
        
          <li><a href="./HeadersController.html">HeadersController</a></li>
        
          <li><a href="./HeadersHelper.html">HeadersHelper</a></li>
        
          <li><a href="./MailSpecification.html">MailSpecification</a></li>
        
          <li><a href="./MailSpecificationController.html">MailSpecificationController</a></li>
        
          <li><a href="./MailSpecificationHelper.html">MailSpecificationHelper</a></li>
        
          <li><a href="./Mailer.html">Mailer</a></li>
        
          <li><a href="./Object.html">Object</a></li>
        
          <li><a href="./PseudoModel.html">PseudoModel</a></li>
        
          <li><a href="./ResourceUsage.html">ResourceUsage</a></li>
        
          <li><a href="./SCGI.html">SCGI</a></li>
        
          <li><a href="./ServerSpecification.html">ServerSpecification</a></li>
        
          <li><a href="./ServerSpecificationController.html">ServerSpecificationController</a></li>
        
          <li><a href="./ServerSpecificationHelper.html">ServerSpecificationHelper</a></li>
        
          <li><a href="./SignalHelper.html">SignalHelper</a></li>
        
          <li><a href="./UrlBreakupTimeSample.html">UrlBreakupTimeSample</a></li>
        
          <li><a href="./UrlTimeSample.html">UrlTimeSample</a></li>
        
          <li><a href="./User.html">User</a></li>
        
          <li><a href="./YAMLConfig.html">YAMLConfig</a></li>
        
          <li><a href="./YAMLWriter.html">YAMLWriter</a></li>
        
        </ul>
        <div id="no-class-search-results" style="display: none;">No matching classes.</div>
      </div>

      
    </div>
  </div>

  <div id="documentation">
    <h1 class="class">ExceptionsController</h1>

    <div id="description" class="description">
      
<p>Controller class is used to handle all the views for exception handling
feature.</p>

    </div><!-- description -->

    
    
    
    <div id="5Buntitled-5D" class="documentation-section">
      

      

      

      

      <!-- Methods -->
      
      <div id="public-instance-method-details" class="method-section section">
        <h3 class="section-header">Public Instance Methods</h3>

      
        <div id="change_status-method" class="method-detail ">
          <a name="method-i-change_status"></a>

          
          <div class="method-heading">
            <span class="method-name">change_status</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Method is used to update the status for selected exceptions.</p>
            

            
            <div class="method-source-code" id="change_status-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 106</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_status</span>    

  <span class="ruby-ivar">@application_name</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]
  <span class="ruby-identifier">app_id</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">get_application_data</span>(<span class="ruby-ivar">@application_name</span>).<span class="ruby-identifier">id</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_ids</span>] <span class="ruby-keyword">and</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>]
    <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_ids</span>].<span class="ruby-identifier">collect!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>].<span class="ruby-identifier">downcase</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">'delete'</span>

      <span class="ruby-keyword">when</span> <span class="ruby-string">'ignore'</span>
        <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">update_all_status_to</span>(<span class="ruby-constant">IGNORED_EXCEPTION</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_ids</span>])
      <span class="ruby-keyword">when</span> <span class="ruby-string">'close'</span>
        <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">update_all_status_to</span>(<span class="ruby-constant">CLOSED_EXCEPTION</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_ids</span>])
      <span class="ruby-keyword">when</span> <span class="ruby-string">'open'</span>
        <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">update_all_status_to</span>(<span class="ruby-constant">OPEN_EXCEPTION</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_ids</span>])
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">status</span> = <span class="ruby-identifier">get_status_const</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:current_status</span>])
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>] = <span class="ruby-value">5</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>]
  <span class="ruby-ivar">@exceptions</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_all</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>],<span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>])
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@exceptions</span>.<span class="ruby-identifier">out_of_bounds?</span> <span class="ruby-keyword">and</span> (<span class="ruby-identifier">page</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-ivar">@exceptions</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_all</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">page</span>,<span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>])
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">render</span> <span class="ruby-value">:update</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">page</span>.<span class="ruby-identifier">replace_html</span> <span class="ruby-string">'data_div'</span>, <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'exception_list_partial'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> { <span class="ruby-value">:current_status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">status</span>, <span class="ruby-value">:status_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:current_status</span>]}  
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- change_status-source -->
            
          </div>

          

          
        </div><!-- change_status-method -->

      
        <div id="delete_exception_class-method" class="method-detail ">
          <a name="method-i-delete_exception_class"></a>

          
          <div class="method-heading">
            <span class="method-name">delete_exception_class</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is used to remove the exception classes from configuration file</p>
            

            
            <div class="method-source-code" id="delete_exception_class-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 162</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">delete_exception_class</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>] <span class="ruby-keyword">and</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_class</span>]
    <span class="ruby-ivar">@exception_classes</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">delete_exception_class_from_config</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>],<span class="ruby-identifier">params</span>[<span class="ruby-value">:exception_class</span>])
    <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'add_and_list_exception_classes'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]}
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">error</span> = <span class="ruby-string">&quot;You have been redircted, because application name and exception class were missing&quot;</span>
    <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'index'</span> ,<span class="ruby-value">:notice</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- delete_exception_class-source -->
            
          </div>

          

          
        </div><!-- delete_exception_class-method -->

      
        <div id="get_exception-method" class="method-detail ">
          <a name="method-i-get_exception"></a>

          
          <div class="method-heading">
            <span class="method-name">get_exception</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is used to put the exception count on the home tab of the admin
panel.</p>
            

            
            <div class="method-source-code" id="get_exception-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_exception</span>
  <span class="ruby-identifier">exceptions_count</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">exceptions_count</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>])  
  <span class="ruby-keyword">if</span>  <span class="ruby-identifier">exceptions_count</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">link_text</span> = <span class="ruby-node">&quot;Yes (#{exceptions_count})&quot;</span>
    <span class="ruby-identifier">exception_span_data</span> = <span class="ruby-identifier">link_text</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">exception_span_data</span> = <span class="ruby-string">&quot;No&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'link_partial'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-value">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">exception_span_data</span>}
<span class="ruby-keyword">end</span></pre>
            </div><!-- get_exception-source -->
            
          </div>

          

          
        </div><!-- get_exception-method -->

      
        <div id="get_exceptions_list-method" class="method-detail ">
          <a name="method-i-get_exceptions_list"></a>

          
          <div class="method-heading">
            <span class="method-name">get_exceptions_list</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Method sets the application name in the in the session and redirect it to
the method index.</p>
            

            
            <div class="method-source-code" id="get_exceptions_list-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 88</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">get_exceptions_list</span>
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:exceptions_application_name</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value">:application_name</span>]
  <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'index'</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- get_exceptions_list-source -->
            
          </div>

          

          
        </div><!-- get_exceptions_list-method -->

      
        <div id="index-method" class="method-detail ">
          <a name="method-i-index"></a>

          
          <div class="method-heading">
            <span class="method-name">index</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>the method is to render the index page of exception tab. on this page the
exception of the first application in the application array is deiplayed.</p>
            

            
            <div class="method-source-code" id="index-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">index</span> 
  <span class="ruby-identifier">flash</span>[<span class="ruby-value">:notice</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value">:notice</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:notice</span>]
  <span class="ruby-ivar">@apps</span> = <span class="ruby-identifier">get_application_list_for_exceptions</span>
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:application_name</span>] = <span class="ruby-identifier">get_application_list</span>[<span class="ruby-value">0</span>]
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">session</span>[<span class="ruby-value">:exceptions_application_name</span>].<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">app</span> = <span class="ruby-ivar">@apps</span>[<span class="ruby-value">0</span>]
    <span class="ruby-identifier">session</span>[<span class="ruby-value">:exceptions_application_name</span>] = <span class="ruby-identifier">app</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">app</span> = <span class="ruby-identifier">session</span>[<span class="ruby-value">:exceptions_application_name</span>]
  <span class="ruby-keyword">end</span>  
  <span class="ruby-ivar">@application_name</span> = <span class="ruby-identifier">app</span>
  <span class="ruby-identifier">app_id</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">get_application_data</span>(<span class="ruby-identifier">app</span>).<span class="ruby-identifier">id</span> <span class="ruby-keyword">rescue</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@size</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">count_open</span>(<span class="ruby-identifier">app_id</span>)
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>] = <span class="ruby-value">5</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>]
  <span class="ruby-ivar">@exceptions</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_all</span>(<span class="ruby-constant">OPEN_EXCEPTION</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>,<span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>])
<span class="ruby-keyword">end</span></pre>
            </div><!-- index-source -->
            
          </div>

          

          
        </div><!-- index-method -->

      
        <div id="list-method" class="method-detail ">
          <a name="method-i-list"></a>

          
          <div class="method-heading">
            <span class="method-name">list</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is to display the list of exceptions as selection made from
select box.</p>
            

            
            <div class="method-source-code" id="list-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 65</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">list</span>
  <span class="ruby-ivar">@application_name</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:application_name</span>]
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:exceptions_application_name</span>] = <span class="ruby-ivar">@application_name</span>
  <span class="ruby-identifier">app_id</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">get_application_data</span>(<span class="ruby-ivar">@application_name</span>).<span class="ruby-identifier">id</span>    
  <span class="ruby-ivar">@size</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">count_open</span>(<span class="ruby-identifier">app_id</span>)
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>] = <span class="ruby-value">5</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>]
  <span class="ruby-ivar">@exceptions</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_all</span>(<span class="ruby-constant">OPEN_EXCEPTION</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>,<span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>])
  <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'exceptions_listing_partial'</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- list-source -->
            
          </div>

          

          
        </div><!-- list-method -->

      
        <div id="list_statuswise_exceptions-method" class="method-detail ">
          <a name="method-i-list_statuswise_exceptions"></a>

          
          <div class="method-heading">
            <span class="method-name">list_statuswise_exceptions</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>Method is used to list the exceptions with different status.</p>
            

            
            <div class="method-source-code" id="list_statuswise_exceptions-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 94</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">list_statuswise_exceptions</span>
  <span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value">:per_page</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:per_page</span>]     
  <span class="ruby-identifier">app_id</span> = <span class="ruby-constant">App</span>.<span class="ruby-identifier">get_application_data</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]).<span class="ruby-identifier">id</span>
  <span class="ruby-ivar">@application_name</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]
  <span class="ruby-identifier">status</span> = <span class="ruby-identifier">get_status_const</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>])
  <span class="ruby-ivar">@exceptions</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_all</span>(<span class="ruby-identifier">status</span>, <span class="ruby-identifier">app_id</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1</span>,<span class="ruby-identifier">session</span>[<span class="ruby-value">:per_page</span>])
  <span class="ruby-identifier">render</span> <span class="ruby-value">:update</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">page</span>.<span class="ruby-identifier">replace_html</span> <span class="ruby-string">'data_div'</span>, <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'exception_list_partial'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> { <span class="ruby-value">:current_status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">status</span>, <span class="ruby-value">:status_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>] }      
  <span class="ruby-keyword">end</span> 
<span class="ruby-keyword">end</span></pre>
            </div><!-- list_statuswise_exceptions-source -->
            
          </div>

          

          
        </div><!-- list_statuswise_exceptions-method -->

      
        <div id="save_exception_class-method" class="method-detail ">
          <a name="method-i-save_exception_class"></a>

          
          <div class="method-heading">
            <span class="method-name">save_exception_class</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is used to fetch the app_id and exception_class from user and
call the add_exception_class_in_config_file method to save the exception
classes</p>
            

            
            <div class="method-source-code" id="save_exception_class-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 150</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save_exception_class</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]
    <span class="ruby-identifier">flash</span>[<span class="ruby-value">:notice</span>] = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">add_exception_class</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>],<span class="ruby-identifier">params</span>[<span class="ruby-value">:exception</span>][<span class="ruby-value">:class</span>])
    <span class="ruby-ivar">@exception_classes</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_exception_classes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>])
    <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'add_and_list_exception_classes'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]}
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">error</span> = <span class="ruby-string">&quot;You have been redircted, because application name was missing&quot;</span>
    <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'index'</span> ,<span class="ruby-value">:notice</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- save_exception_class-source -->
            
          </div>

          

          
        </div><!-- save_exception_class-method -->

      
        <div id="save_exception_class_form-method" class="method-detail ">
          <a name="method-i-save_exception_class_form"></a>

          
          <div class="method-heading">
            <span class="method-name">save_exception_class_form</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is used to render the add_application_class_form partial with
all the exception classes stored in configuration file, with respect to the
selected application</p>
            

            
            <div class="method-source-code" id="save_exception_class_form-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 138</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">save_exception_class_form</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]
    <span class="ruby-ivar">@exception_classes</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">get_exception_classes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>])
    <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;add_exception_class_form&quot;</span> , <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span>{<span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>]}
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">error</span> = <span class="ruby-string">&quot;You have been redircted, because application name was missing&quot;</span>
    <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'index'</span> ,<span class="ruby-value">:notice</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">error</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
            </div><!-- save_exception_class_form-source -->
            
          </div>

          

          
        </div><!-- save_exception_class_form-method -->

      
        <div id="show-method" class="method-detail ">
          <a name="method-i-show"></a>

          
          <div class="method-heading">
            <span class="method-name">show</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is to display the information of the specific exception.</p>
            

            
            <div class="method-source-code" id="show-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">show</span>    
  <span class="ruby-ivar">@exception</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">first</span>(<span class="ruby-value">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">&quot;id = ?&quot;</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]]) <span class="ruby-comment"># found include bug with eager loading, its fetching all the associated records     </span>
  <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'show'</span>, <span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> { <span class="ruby-value">:status_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>], <span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>], <span class="ruby-value">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>] }
<span class="ruby-keyword">end</span></pre>
            </div><!-- show-source -->
            
          </div>

          

          
        </div><!-- show-method -->

      
        <div id="show_exception_backtrace-method" class="method-detail ">
          <a name="method-i-show_exception_backtrace"></a>

          
          <div class="method-heading">
            <span class="method-name">show_exception_backtrace</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is to show the backtrace of the exception</p>
            

            
            <div class="method-source-code" id="show_exception_backtrace-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 53</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">show_exception_backtrace</span>
  <span class="ruby-ivar">@exception</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">first</span>(<span class="ruby-value">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">&quot;id = ?&quot;</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]])
  <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'exception_backtrace_partial'</span>,<span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-value">:index</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:index</span>].<span class="ruby-identifier">to_i</span>,<span class="ruby-value">:status_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>], <span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>], <span class="ruby-value">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>] }
<span class="ruby-keyword">end</span></pre>
            </div><!-- show_exception_backtrace-source -->
            
          </div>

          

          
        </div><!-- show_exception_backtrace-method -->

      
        <div id="show_exception_environment-method" class="method-detail ">
          <a name="method-i-show_exception_environment"></a>

          
          <div class="method-heading">
            <span class="method-name">show_exception_environment</span><span
              class="method-args">()</span>
            <span class="method-click-advice">click to toggle source</span>
          </div>
          

          <div class="method-description">
            
            <p>This method is to show the environment details of the exception</p>
            

            
            <div class="method-source-code" id="show_exception_environment-source">
<pre>
<span class="ruby-comment"># File app/controllers/exceptions_controller.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">show_exception_environment</span>
  <span class="ruby-ivar">@exception</span> = <span class="ruby-constant">AppException</span>.<span class="ruby-identifier">first</span>(<span class="ruby-value">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-string">&quot;id = ?&quot;</span>, <span class="ruby-identifier">params</span>[<span class="ruby-value">:id</span>]])
  <span class="ruby-identifier">render</span> <span class="ruby-value">:partial</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'exception_environment_partial'</span>,<span class="ruby-value">:locals</span> =<span class="ruby-operator">&gt;</span> {<span class="ruby-value">:index</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:index</span>].<span class="ruby-identifier">to_i</span>,<span class="ruby-value">:status_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:status_name</span>], <span class="ruby-value">:app_name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:app_name</span>], <span class="ruby-value">:page</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:page</span>]}
<span class="ruby-keyword">end</span></pre>
            </div><!-- show_exception_environment-source -->
            
          </div>

          

          
        </div><!-- show_exception_environment-method -->

      
      </div><!-- public-instance-method-details -->
    
    </div><!-- 5Buntitled-5D -->
  

  </div><!-- documentation -->

  <div id="validator-badges">
    <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
    <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
      Rdoc Generator</a> 2</small>.</p>
  </div>

</body>
</html>

